// Copyright(c) 2011 Matthew McMullan, Jorel Lalicki and Mike Heise, Jorel Lalicki and Mike Heise. See copying.txt for details.

#ifndef __agml_matrix_stream_h__
#define __agml_matrix_stream_h__

// make sure that this file is never included directly
#ifndef __agml_agml_h__
#error "Include AGML from agml.h only. This file is not a valid entry point for the library."
#endif

using std::ostream;

namespace agml {
	template<typename t, u32 width, u32 height>
	ostream &operator<<(ostream &out, const mstatic<t,width,height> &data) {
		u32 y, x;
		out << "{ ";
		for (x=0; x<width-1; ++x) {
			out << data.get(x,0) << ",\t";
		}
		out << data.get(width-1,0) << "\n";
		for (y=1; y < height-1; ++y) {
			out << "  ";
			for (x=0; x<width-1; ++x) {
				out << data.get(x,y) << ",\t";
			}
			out << data.get(width-1,y) << "\n";
		}
		out << "  ";
		for (x=0; x<width-1; ++x) {
			out << data.get(x,height-1) << ",\t";
		}
		out << data.get(width-1,height-1) << " }";
		return out;
	}
}

#endif
